home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / MUI / MCC_HTMLtext / Developer / AutoDocs / HTMLtext_mcc.doc next >
Text File  |  1997-09-11  |  11KB  |  370 lines

  1. TABLE OF CONTENTS
  2.  
  3. HTMLtext.mcc/HTMLtext.mcc
  4. HTMLtext.mcc/MUIA_HTMLtext_Block
  5. HTMLtext.mcc/MUIA_HTMLtext_Clicked
  6. HTMLtext.mcc/MUIA_HTMLtext_CloseURLHook
  7. HTMLtext.mcc/MUIA_HTMLtext_Contents
  8. HTMLtext.mcc/MUIA_HTMLtext_DoubleClick
  9. HTMLtext.mcc/MUIA_HTMLtext_ElementList
  10. HTMLtext.mcc/MUIA_HTMLtext_LoadImages
  11. HTMLtext.mcc/MUIA_HTMLtext_OpenURLHook
  12. HTMLtext.mcc/MUIA_HTMLtext_Path
  13. HTMLtext.mcc/MUIA_HTMLtext_Title
  14. HTMLtext.mcc/MUIA_HTMLtext_URL
  15. HTMLtext.mcc/MUIA_HTMLtext_VLinkHook
  16. HTMLtext.mcc/MUIM_HTMLtext_Jump
  17. HTMLtext.mcc/MUIM_HTMLtext_Mark
  18. HTMLtext.mcc/MUIM_HTMLtext_Reload
  19. HTMLtext.mcc/HTMLtext.mcc                           HTMLtext.mcc/HTMLtext.mcc
  20.  
  21.    COPYRIGHT
  22.  
  23.      HTMLtext.mcc
  24.      (C)opyright by Dirk Holtwick, 1997
  25.  
  26.      This product is SHAREWARE and the source is available from
  27.      the author only if you are a registred user.
  28.  
  29.      The HTMLtext class may be used in every SHAREWARE project
  30.      without paying any fee. For comercial applications you need
  31.      a written permission of the author.
  32.  
  33.    DESCRIPTION
  34.      The HTMLtext class for MUI dispalys a subset of HTML in a virtual
  35.      group. You may put it into a ScrollgroupObject to move easier
  36.      through the text.
  37.  
  38.    AUTHOR
  39.      Dirk Holtwick
  40.      Grenzdicker Str. 13
  41.      D-47665 Sonsbeck
  42.      dirco@uni-duisburg.de
  43.      http://fsrinfo.uni-duisburg.de/~dirk/
  44.  
  45. HTMLtext.mcc/MUIA_HTMLtext_Block             HTMLtext.mcc/MUIA_HTMLtext_Block
  46.  
  47.    NAME
  48.      MUIA_HTMLtext_Block -- [..G], char *
  49.  
  50.    FUNCTION
  51.      Get a pointer to the marked text. The text will be stripped of any
  52.      HTML informations.
  53.  
  54.    EXAMPLE
  55.      moreHTML.c
  56.  
  57.    SEE ALSO
  58.      MUIA_HTMLtext_DoubleClick
  59.  
  60. HTMLtext.mcc/MUIA_HTMLtext_Clicked         HTMLtext.mcc/MUIA_HTMLtext_Clicked
  61.  
  62.    NAME
  63.      MUIA_HTMLtext_Clicked -- [..G], BOOL
  64.  
  65.    FUNCTION
  66.      Indicates wether the recent displayed document was choosen by
  67.      clicking on a link (result is TRUE) in a document or by setting
  68.      MUIA_HTMLtext_Contents or MUIA_HTMLtext_URL (result is FALSE).
  69.  
  70. HTMLtext.mcc/MUIA_HTMLtext_CloseURLHookTMLtext.mcc/MUIA_HTMLtext_CloseURLHook
  71.  
  72.    NAME
  73.      MUIA_HTMLtext_CloseURLHook -- [IS.], struct Hook *
  74.  
  75.    FUNCTION
  76.      This hook will be called, always when the local copy of an URL
  77.      is not longer needed. You may delete this file if you want,
  78.      otherwise it will never be deleted.
  79.  
  80.    EXAMPLE
  81.      moreHTML.c
  82.  
  83.    SEE ALSO
  84.      MUIA_HTMLtext_URL, MUIA_HTMLtext_OpenURLHook
  85.  
  86. HTMLtext.mcc/MUIA_HTMLtext_Contents       HTMLtext.mcc/MUIA_HTMLtext_Contents
  87.  
  88.    NAME
  89.      MUIA_HTMLtext_Contents -- (V1 ) [ISG], STRPTR
  90.  
  91.    FUNCTION
  92.      HTML text to be displayed in the HTMLtext object.
  93.  
  94.      This string may content HTML tags and the equivalent
  95.      closing tags (e.g. <b>..</b>. Not supported tags will not have any
  96.      effect to the output. The structure defined by the HTML specifications
  97.      have to be respected. See example for a simple HTML demo text.
  98.      To know about the supported tags and attributes please refer to
  99.      the documentation of the HTMLtext class.
  100.  
  101.      See also further documentations of the HTML language.
  102.  
  103.    EXAMPLE
  104.      MUIA_HTMLtext_Contents,
  105.         "<html>"
  106.         "  <head>"
  107.         "     <title>Example</title>"
  108.         "  </head>"
  109.         "  <body>"
  110.         "     <p>A simple example for the HTML class</p>"
  111.         "  </body>"
  112.         "</html>"
  113.  
  114.    BUG
  115.       If you set a text with background pattern in a not opened
  116.       window the background may appear crippled. (Don't ask me why!)
  117.  
  118.    SEE ALSO
  119.       MUIA_HTMLtext_URL, MUIA_HTMLtext_Path, MUIA_HTMLtext_Title
  120.  
  121. HTMLtext.mcc/MUIA_HTMLtext_DoubleClick HTMLtext.mcc/MUIA_HTMLtext_DoubleClick
  122.  
  123.    NAME
  124.      MUIA_HTMLtext_DoubleClick -- [..G], BOOL
  125.  
  126.    FUNCTION
  127.      This attribute is set to TRUE whenever the user
  128.      double clicks on an object in the text.
  129.  
  130.    SEE ALSO
  131.      MUIA_HTMLtext_Block
  132.  
  133. HTMLtext.mcc/MUIA_HTMLtext_ElementList HTMLtext.mcc/MUIA_HTMLtext_ElementList
  134.  
  135.    NAME
  136.      MUIA_HTMLtext_ElementList -- [..G], struct MUIS_HTMLtext_Element *
  137.  
  138.    FUNCTION
  139.      Gets a pointer to the first element of the list created by HTMLtext.mcc
  140.      to handle the text objects.
  141.  
  142.      The structure MUIS_HTMLtext_Element looks like this:
  143.  
  144.         struct MUIS_HTMLtext_Element
  145.         {
  146.            struct   MUIS_HTMLtext_Element *next;
  147.            UWORD    type;
  148.            UWORD    x,y,dx,dy;
  149.            Object   *obj;
  150.            char     *text;
  151.         };
  152.  
  153.      You can walk through the list by following 'next' until it is NULL.
  154.      'x','y' contain the eventually coords of the related MUI object
  155.      relatively to the upper left corner of the HTML object. 'dx' and 'dy'
  156.      contain the width and height of the object.
  157.      'type' can contain the various values of them only the followings
  158.      are public:
  159.  
  160.         MUIV_HTMLtext_Element_Text:
  161.            You may find a pointer to the text in 'text' and in 'obj'
  162.            a pointer to a MUI object of an internal custom class of
  163.            HTMLtext.mcc.
  164.  
  165.         MUIV_HTMLtext_Element_Image:
  166.            'obj' contains a pointer to the MUI object of an internal
  167.            custom class of HTMLtext.mcc.
  168.  
  169.         MUIV_HTMLtext_Element_HorizRule:
  170.            'obj' contains a pointer to the MUI object of 'Rectangle Class'.
  171.  
  172.      You may also use some macros defined in the include files. (See example)
  173.  
  174.    EXAMPLE
  175.      // Print active text of 'obj' (an HTMLtext object)
  176.  
  177.      struct MUIS_HTMLtext_Element *el;
  178.  
  179.      set(app, MUIA_Application_Sleep, TRUE);      // Better, to avoid confusi
  180. on
  181.      get(obj, MUIA_HTMLtext_ElementList, &el);
  182.      while(el)
  183.      {
  184.         printf("%s", MACRO_HTMLtext_GetText(el));
  185.         el = el->next;
  186.      }
  187.      set(app, MUIA_Application_Sleep, FALSE);
  188.  
  189. HTMLtext.mcc/MUIA_HTMLtext_LoadImages   HTMLtext.mcc/MUIA_HTMLtext_LoadImages
  190.  
  191.    NAME
  192.      MUIA_HTMLtext_LoadImages -- [IS.], BOOL
  193.  
  194.    FUNCTION
  195.      Override the users configuration reguarding the loading of images in
  196.      the HTML document. This may be usefull, if you use the HTMLtext.mcc
  197.      to display informations in which the image is a very important part.
  198.      In all other cases it might be better to let the user choose.
  199.  
  200.    EXAMPLE
  201.      moreHTML.c
  202.  
  203. HTMLtext.mcc/MUIA_HTMLtext_OpenURLHook HTMLtext.mcc/MUIA_HTMLtext_OpenURLHook
  204.  
  205.    NAME
  206.      MUIA_HTMLtext_OpenURLHook -- [IS.], struct Hook *
  207.  
  208.    FUNCTION
  209.      This hook will be called, always when an URL has to be loaded
  210.      whose protocol is not supported. These URL's may come from
  211.      hyperlinks, images or else.
  212.      The hook function will receive a pointer to a structure described bellow
  213.      in the register a1. In a0 is a pointer to the calling hook and in a2
  214.      a pointer to the calling object.
  215.  
  216.         struct
  217.         {
  218.            char *URL;
  219.            char *TmpFilename;
  220.         };
  221.  
  222.      The member 'URL' contains the full name of the URL. 'TmpFilename' is an
  223.      array of char where to the calling hook copies the name of a local file
  224.      that contains the data coming from the URL. The default name already
  225.      standing in 'TmpFilename' will be a file in "T:". (Created by SAS/C
  226.      tmpnam() function).
  227.      However, you may change the name as you like as long as it is not long
  228.      than 256 bytes.
  229.  
  230.      The class will test if the temporary file exists or not. If not will
  231.      follow an ordinary error message, that the file has not been found.
  232.  
  233.      FUTURE:
  234.  
  235.      For the future I plan to do file notification, that means that you may
  236.      launch a process to load data from the URL in a file. Then you leave the
  237.      function called by the Hook but returning TRUE and the name of the file.
  238.      Once the file is loaded comletely, HTMLtext.mcc will refresh the display
  239. .
  240.      Due to some technical problems it will take some time, before everything
  241.      works fine :(
  242.  
  243.    EXAMPLE
  244.      moreHTML.c
  245.  
  246.    SEE ALSO
  247.      MUIA_HTMLtext_URL, MUIA_HTMLtext_CloseURLHook
  248.  
  249. HTMLtext.mcc/MUIA_HTMLtext_Path               HTMLtext.mcc/MUIA_HTMLtext_Path
  250.  
  251.    NAME
  252.      MUIA_HTMLtext_Path -- (V1 ) [ISG], STRPTR
  253.  
  254.    FUNCTION
  255.      Sets the path to the used document. This value will be used, if
  256.      there are images to load or links to follow and they not have
  257.      a full path. If you use MUIA_HTMLtext_LoadContents, the path will
  258.      be automatically set.
  259.  
  260.    SEE ALSO
  261.      MUIA_HTMLtext_URL
  262.  
  263. HTMLtext.mcc/MUIA_HTMLtext_Title             HTMLtext.mcc/MUIA_HTMLtext_Title
  264.  
  265.    NAME
  266.      MUIA_HTMLtext_Title -- (V1 ) [..G], STRPTR
  267.  
  268.    FUNCTION
  269.      Gets the title of the document currently active. The title has
  270.      to be specified in the text between <title> and </title> tags.
  271.  
  272.    SEE ALSO
  273.      MUIA_HTMLtext_Contents
  274.  
  275. HTMLtext.mcc/MUIA_HTMLtext_URL                 HTMLtext.mcc/MUIA_HTMLtext_URL
  276.  
  277.    NAME
  278.      MUIA_HTMLtext_URL -- [ISG], STRPTR
  279.  
  280.    FUNCTION
  281.      Name of an URL to be loaded. If the URL is of an not supported
  282.      protocol, the MUIA_HTMLtext_OpenURLHook will be called.
  283.  
  284.      The only supported protocol, yet, is "file://". Names without
  285.      any protocol specification will be handled as normal local filenames.
  286.  
  287.    SEE ALSO
  288.       MUIA_HTMLtext_OpenURLHook, MUIA_HTMLtext_Path, MUIA_HTMLtext_Title
  289.  
  290. HTMLtext.mcc/MUIA_HTMLtext_VLinkHook     HTMLtext.mcc/MUIA_HTMLtext_VLinkHook
  291.  
  292.    NAME
  293.      MUIA_HTMLtext_VLinkHook -- [IS.], struct Hook *
  294.  
  295.    FUNCTION
  296.      This hook will always be called, when the parser finds an A tag with
  297.      a HREF attribute. As argument the URL of this link will be passed and
  298.      the function has to return TRUE if this URL was already visited or
  299.      FALSE if not.
  300.  
  301.    EXAMPLE
  302.      HTMLtext-Demo.c
  303.  
  304. HTMLtext.mcc/MUIM_HTMLtext_Jump               HTMLtext.mcc/MUIM_HTMLtext_Jump
  305.  
  306.    NAME
  307.      MUIM_HTMLtext_Jump
  308.  
  309.    SYNOPSIS
  310.      DoMethod(obj,MUIM_HTMLtext_Jump, struct MUIS_HTMLtext_Element *el);
  311.  
  312.    FUNCTION
  313.      Jump to position of an element to make it visible to the user.
  314.  
  315.    INPUTS
  316.      el   - The element to be jumped to
  317.  
  318.    RESULT
  319.      If for some resons it was impossible to jump, FALSE is returned.
  320.  
  321.    BUGS
  322.      Function may crash if element passed are not in element list.
  323.  
  324.    SEE ALSO
  325.      MUIA_HTMLtext_ElementList, MUIA_Virtgroup_Top
  326.  
  327. HTMLtext.mcc/MUIM_HTMLtext_Mark               HTMLtext.mcc/MUIM_HTMLtext_Mark
  328.  
  329.    NAME
  330.      MUIM_HTMLtext_Mark
  331.  
  332.    SYNOPSIS
  333.      DoMethod(obj,MUIM_HTMLtext_Mark,
  334.         struct MUIS_HTMLtext_Element *first,
  335.         struct MUIS_HTMLtext_Element *last);
  336.  
  337.    FUNCTION
  338.      Mark a part of the HTML text. Use list from MUIA_HTMLtext_ElementList
  339.  
  340.    INPUTS
  341.      first  - The first element to be marked
  342.      last   - The last  element to be marked
  343.  
  344.    RESULT
  345.      The result value is currently undefined.
  346.  
  347.    BUGS
  348.      Function may crash if element passed are not in element list.
  349.  
  350.    SEE ALSO
  351.      MUIA_HTMLtext_ElementList
  352.  
  353. HTMLtext.mcc/MUIM_HTMLtext_Reload           HTMLtext.mcc/MUIM_HTMLtext_Reload
  354.  
  355.    NAME
  356.      MUIM_HTMLtext_Reload
  357.  
  358.    SYNOPSIS
  359.      DoMethod(obj,MUIM_HTMLtext_Reload);
  360.  
  361.    FUNCTION
  362.      Reloads the current page. Use this, if you know that the documents
  363.      contents have changed, because MUIA_HTMLtext_URL will not reload
  364.      the document, if the URL given is the same as the one currently
  365.      displayed.
  366.  
  367.    SEE ALSO
  368.      MUIA_HTMLtext_URL
  369.  
  370.